function deepClone(target) {
	let result;
	if (typeof target === 'object') {
		if (Array.isArray(target)) {
			result = [];
			for (let i in target) {
				result.push(deepClone(target[i]))
			}
		} else if (target === null) {
			result = null;
		} else if (target.constructor === RegExp) {
			result = target;
		} else {
			result = {};
			for (let i in target) {
				result[i] = deepClone(target[i]);
			}
		}
	} else {
		result = target;
	}
	return result;
}

export default deepClone;
